package edu.gmu.projects.fireresponder.gui;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import edu.gmu.projects.fireresponder.R;

public class AssetDialogTabWidget extends TabActivity {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.asset_tab_widget);

		TabHost tabHost = getTabHost();
		TabHost.TabSpec spec;
		Intent intent;

		Bundle bundle = new Bundle();
		bundle.putString(SituationMap.ASSET_ID, getIntent().getExtras()
				.getString(SituationMap.ASSET_ID));
		bundle.putString(SituationMap.ASSET_CLASS, getIntent().getExtras()
				.getString(SituationMap.ASSET_CLASS));
		bundle.putDouble(SituationMap.LAT, getIntent().getExtras().getDouble(
				SituationMap.LAT));
		bundle.putDouble(SituationMap.LNG, getIntent().getExtras().getDouble(
				SituationMap.LNG));

		intent = new Intent(this, AssetDialogMessageTab.class)
				.putExtras(bundle);
		spec = tabHost.newTabSpec("message").setIndicator("New")
				.setContent(intent);
		tabHost.addTab(spec);

		bundle = new Bundle();
		bundle.putString(SituationMap.ASSET_ID, getIntent().getExtras()
				.getString(SituationMap.ASSET_ID));
		bundle.putString(SituationMap.ASSET_CLASS, getIntent().getExtras()
				.getString(SituationMap.ASSET_CLASS));
		bundle.putDouble(SituationMap.LAT, getIntent().getExtras().getDouble(
				SituationMap.LAT));
		bundle.putDouble(SituationMap.LNG, getIntent().getExtras().getDouble(
				SituationMap.LNG));

		intent = new Intent().setClass(this, AssetDialogMessagesTab.class)
				.putExtras(bundle);
		spec = tabHost.newTabSpec("messages").setIndicator("Messages")
				.setContent(intent);
		tabHost.addTab(spec);


		bundle = new Bundle();
		bundle.putDouble(SituationMap.LAT, getIntent().getExtras().getDouble(
				SituationMap.LAT));
		bundle.putDouble(SituationMap.LNG, getIntent().getExtras().getDouble(
				SituationMap.LNG));

		intent = new Intent().setClass(this, AssetDialogGalleryTab.class)
				.putExtras(bundle);
		spec = tabHost.newTabSpec("photos").setIndicator("Photos").setContent(
				intent);
		tabHost.addTab(spec);

		bundle = new Bundle();
		bundle.putString(SituationMap.ASSET_ID, getIntent().getExtras()
				.getString(SituationMap.ASSET_ID));
		bundle.putString(SituationMap.ASSET_CLASS, getIntent().getExtras()
				.getString(SituationMap.ASSET_CLASS));
		bundle.putDouble(SituationMap.PROB_FIRE, getIntent().getExtras()
				.getDouble(SituationMap.PROB_FIRE));
		bundle.putDouble(SituationMap.PROB_PEOPLE, getIntent().getExtras()
				.getDouble(SituationMap.PROB_PEOPLE));
		bundle.putDouble(SituationMap.RELEVANCE, getIntent().getExtras()
				.getDouble(SituationMap.RELEVANCE));
		bundle.putDouble(SituationMap.FIRE_DISTANCE, getIntent().getExtras()
				.getDouble(SituationMap.FIRE_DISTANCE));
		bundle.putInt(SituationMap.TIME_TO_ASSET, getIntent().getExtras()
				.getInt(SituationMap.TIME_TO_ASSET));
		bundle.putDouble(SituationMap.PROB_FIRE_AT_TIME, getIntent()
				.getExtras().getDouble(SituationMap.PROB_FIRE_AT_TIME));

		intent = new Intent().setClass(this, AssetDialogInfoTab.class)
				.putExtras(bundle);
		spec = tabHost.newTabSpec("info").setIndicator("Info").setContent(
				intent);
		tabHost.addTab(spec);

		tabHost.setCurrentTab(0);
	}
}